package com.example.pythondemo.thraed;

import com.example.pythondemo.model.FileNum;
import lombok.SneakyThrows;

public class Monitor implements Runnable {
    private static FileNum fileNum;

    public Monitor(FileNum fileNum) {
        this.fileNum = fileNum;
    }

    @SneakyThrows
    @Override
    public void run() {
        while (!fileNum.isOk()){
            Thread.sleep(1000);
            System.out.println("总文件数：" + fileNum.getAllNum() + "下载成功：" + fileNum.getDownNum() + "失败数：" + fileNum.getFalseNum());
        }

    }

}
